﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Sql;

public partial class Controls_UC_SP_TheoNSX : System.Web.UI.UserControl
{
    BUS_Product Data = new BUS_Product();
    
    protected void Page_Load(object sender, EventArgs e)
    {
        
        LoadData();
    }
    public void LoadData()
    {
        string id_nsx = Request.QueryString["nsx"];
        string id_nhom = Request.QueryString["nhom"];
        DataTable dt = new DataTable();
        if (id_nsx =="" || id_nsx ==null)
        {
            dt.Clear();
            ltrTenNSX.Text = TenNhom();
            dt = Data.Product_GetByTop(0, "GroupProduct_Id like '%" + id_nhom + "%' and [Status] = 1", "[Order]");
            //dt = Data.Product_GetByTop(0, "Manufacturer_Id = " + id_nsx, "[Order]");
            //Response.Write("NHOM "+id_nhom);
            Page.Title = TenNhom();

        }
        else if (id_nhom == "" || id_nhom == null)
        {
            dt.Clear();
            ltrTenNSX.Text = TenNSX();
            dt = Data.Product_GetByTop(0, "Manufacturer_Id = " + id_nsx + " and [Status] = 1", "[Order]");
            //Response.Write("NSX " + id_nsx);
            Page.Title = TenNSX();
        }
        rptNhaSanXuat.DataSource = dt;
        rptNhaSanXuat.DataBind();
    }
    public string TenNSX()
    {
        string tennsx = "ngo vu linh";
        return tennsx;
    }
    public string TenNhom()
    {
        string tennsx = "Nhom";
        return tennsx;
    }
}